package edu.gatech.gro.model;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import edu.gatech.gro.utils.Utils;

public class NamedList extends AbstractObject {

	/* Attributes matching exactly the database model. */
	private int userId;
	private String name;
	private String nameClean;

	/* Attributes to ease the use of the class */
	private User user;
	private ArrayList<ListGroup> itemGroups = new ArrayList<ListGroup>();
	private List<ListItem> unsortedItems;

	public NamedList() {
		super();
	}

	public void setItemGroups(ArrayList<ListGroup> itemGroups) {
		this.itemGroups = itemGroups;
	}

	public ArrayList<ListGroup> getItemGroups() {
		return itemGroups;
	}

	public ArrayList<ListGroup> getItemGroups(Context ctx) {
		if (itemGroups == null && ctx != null) {

		}
		return this.itemGroups;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getNameClean() {
		return nameClean;
	}

	public void setNameClean(String nameClean) {
		this.nameClean = nameClean;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
		this.setNameClean(Utils.cleanName(name));
	}
}
